package com.qsbc.pygram.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qsbc.pygram.entity.JudgeQuestion;
import com.qsbc.pygram.entity.ProgramQuestion;
import com.qsbc.pygram.mapper.JudgeQuestionMapper;
import com.qsbc.pygram.mapper.ProgramQuestionMapper;
import com.qsbc.pygram.service.ProgramQuestionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author baomidou
 * @since 2023-02-01
 */
@Service
public class ProgramQuestionServiceImpl extends ServiceImpl<ProgramQuestionMapper, ProgramQuestion> implements ProgramQuestionService {

    @Autowired
    private ProgramQuestionMapper programQuestionMapper;

    @Override
    public List<ProgramQuestion> findByIdAndType(Integer paperId) {
        return programQuestionMapper.findByIdAndType(paperId);
    }

    @Override
    public IPage<ProgramQuestion> findAll(Page<ProgramQuestion> page) {
        return programQuestionMapper.findAll(page);
    }

    @Override
    public ProgramQuestion findOnlyQuestionId() {
        return programQuestionMapper.findOnlyQuestionId();
    }

    @Override
    public int add(ProgramQuestion programQuestion) {
        return programQuestionMapper.add(programQuestion);
    }

    @Override
    public List<Integer> findBySubject(String subject, Integer pageNo) {
        return programQuestionMapper.findBySubject(subject,pageNo);
    }

    @Override
    public Page<ProgramQuestion> findPage(Page<ProgramQuestion> page, String subject, String section, String level) {
        return programQuestionMapper.findPage(page, subject, section, level);
    }
}
